package com.domain;

import javax.jdo.annotations.IdGeneratorStrategy;
import javax.jdo.annotations.PersistenceCapable;
import javax.jdo.annotations.Persistent;
import javax.jdo.annotations.PrimaryKey;

import com.google.appengine.api.datastore.Key;

@PersistenceCapable
public class Location {
	@PrimaryKey
	@Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY)
	private Key primaryKey;
	
	@Persistent
	private String locationName;
	
	@Persistent
	private String userName;
	
	@Persistent
	private double latitude;
	
	@Persistent
	private double longitude;
	
	@Persistent
	private double errorRadius;
	
	public Location(){
		
	}

	public Key getPrimaryKey() {
		return primaryKey;
	}

	public void setPrimaryKey(Key primaryKey) {
		this.primaryKey = primaryKey;
	}

	public String getLocationName() {
		return locationName;
	}

	public void setLocationName(String locationName) {
		this.locationName = locationName;
	}

	public String getLocationUser() {
		return userName;
	}

	public void setLocationUser(String locationUser) {
		this.userName = locationUser;
	}

	public double getLatitude() {
		return latitude;
	}

	public void setLatitude(double latitude) {
		this.latitude = latitude;
	}

	public double getLongitude() {
		return longitude;
	}

	public void setLongitude(double longitude) {
		this.longitude = longitude;
	}

	public double getErrorRadius() {
		return errorRadius;
	}

	public void setErrorRadius(double errorRadius) {
		this.errorRadius = errorRadius;
	}
	
	@Override
	public String toString(){
		String locString = "";
		locString += "LocName: " + getLocationName() + "\n";
		locString += getLocationUser().toString();
		return locString;
	}
}
